# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
pkgname=typstfmt
pkgver=0.2.7
pkgrel=0
pkgdesc="Basic formatter for the Typst language with a future"
url="https://github.com/astrale-sharp/typstfmt"
# typst
arch="all !s390x !ppc64le !riscv64 !armhf"
license="MIT"
makedepends="cargo cargo-auditable"
subpackages="$pkgname-doc"
source="https://github.com/astrale-sharp/typstfmt/archive/$pkgver/typstfmt-$pkgver.tar.gz
	cargo-update.patch"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/typstfmt "$pkgdir"/usr/bin/typstfmt
	install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
a274b9b26e9583494080a54d6dadf3c0f26db2846659c8fa29af6ca7a42120cb549eef57be2e7d8495a44c9c51d5f2b4d1ff5140f14670b17c12b62a505b5c22  typstfmt-0.2.7.tar.gz
99933e1024dbba7f1de34cd756a025e5023518c7fb79da61885379549c3beaef7320d1acb105b64e092c9c9e922f2518b1b247ba5c1b15665ea04706596eed39  cargo-update.patch
"
